<?php session_start();
if ((isset($_SESSION['username'])) && (isset($_SESSION['password']))) {
    $username = $_SESSION['username'];
    $password = $_SESSION['password'];
    $con = mysqli_connect("localhost", "root", "deng123", "housekeeping", "3306") or die("unable to connect");
    $query = "select * from user_details where username='$username'";
    $result = mysqli_query($con, $query);
    $count = 0;
    if ($result) {
        while ($row = mysqli_fetch_array($result)) {
            $dbusname = $row['username'];
            $dbpassword = $row['password'];
            if ($username == $dbusname && $dbpassword = $password) {
                $count = $count + 1;
            }
        }
        if ($count == 1) {
            header("Location:find_service.php");
        } else {
            $i = 0;
            $q = "select * from worker_details where username='$username'";
            $res = mysqli_query($con, $q);
            if ($res) {
                while ($row = mysqli_fetch_array($res)) {
                    $dbusname = $row['username'];
                    $dbverification = $row['verification'];
                    $dbpassword = $row['password'];
                    $dbcard_no = $row['card_no'];
                    if ($username == $dbusname && $dbpassword = $password && $dbverification == 'Confirmed' && $dbcard_no != null) {
                        $i = $i + 1;
                    }
                }
                if ($i == 1) {
                    header("Location:worker_profile.php");
                } else {
?>
                    <!DOCTYPE html>
                    <html lang="en">

                    <head>

                        <meta charset="utf-8">
                        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
                        <meta name="description" content="">
                        <meta name="author" content="">

                        <title>好先生 | 家政服务</title>
                        <link rel="shortcut icon" href="img/favicon.ico" />
                        <!-- Bootstrap core CSS -->
                        <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

                        <!-- Custom fonts for this template -->
                        <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet">
                        <link rel="stylesheet" href="vendor/simple-line-icons/css/simple-line-icons.css">

                        <!-- Plugin CSS -->
                        <link rel="stylesheet" href="device-mockups/device-mockups.min.css">

                        <!-- Custom styles for this template -->
                        <link href="css/style.css" rel="stylesheet">
                        <link href="css/hover-min.css" rel="stylesheet">
                    </head>

                    <body id="page-top">

                        <!-- Navigation -->
                        <nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
                            <div class="container">
                                <div class="navbar-header">
                                    <a href="#top">
                                        <img class="img-rounded" src="img/logo.png" />
                                    </a>
                                </div>
                                &nbsp;
                                <a class="navbar-brand " href="#page-top">
                                    <h2><small style="font-family: Arial;border-bottom: 2px solid gainsboro">服务专家</small></h2>
                                </a>
                                <button class="navbar-toggler navbar-toggler-right ml-auto" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
                                    菜单
                                    <i class="fas fa-bars"></i>
                                </button>
                                <div class="collapse navbar-collapse" id="navbarResponsive">
                                    <ul class="navbar-nav ml-auto">
                                        <li class="nav-item">
                                            <a class="nav-link js-scroll-trigger hvr-bounce-to-right" href="#contact">关于</a>
                                        </li>
                                        <li class="nav-item">
                                            <a class="nav-link js-scroll-trigger hvr-bounce-to-right" href="userlogin.php">用户登录/注册</a>
                                        </li>
                                        <li class="nav-item">
                                            <a class="nav-link js-scroll-trigger hvr-bounce-to-right" href="workerlogin.html">成为专业人士</a>
                                        </li>
                                        <li class="nav-item">
                                            <a class="nav-link js-scroll-trigger hvr-bounce-to-right" href="contact.html">联系我们</a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </nav>
                        <header class="masthead">
                            <div class="container h-100">
                                <div class="row h-100">
                                    <div class="col-lg-7 my-auto">
                                        <div class="header-content mx-auto">
                                            <div style="text-align: center;">
                                                <h1 class="mb-5" style="font-family: Catamaran">欢迎来到 <b>好先生 </b><br>专业 <br>家政服务网站 <br> 专门为国人提供专业服务</h1>
                                                <a href="#features" class="btn btn-outline btn-xl js-scroll-trigger"><b>探索我们的服务!</b></a>
                                            </div>
                                        </div>
                                    </div>
                                    <br><br>
                                    <div class="col-lg-5 my-auto">
                                        <div class="device-container">
                                            <div class="device-mockup ipad white">
                                                <div class="device">
                                                    <div class="screen">
                                                        <!-- Demo image for screen mockup, you can put an image here, some HTML, an animation, video, or anything else! -->
                                                        <img src="img/q.jpg" class="img-fluid" alt="Image">

                                                        <div class="overlay">
                                                            <div class="text"><img src="img/p.jpg" alt="Image" class="image"></div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </header>
                        <section class="features" id="features">
                            <div class="container">
                                <div style="text-align: center">
                                    <h1 class="mb-5 text-dark" style="font-family: Catamaran">立刻获得实惠可靠的服务.</h1>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 col-lg-12 my-auto">
                                        <div class="container-fluid">
                                            <div class="row">
                                                <div class="col-sm-6 col-lg-4 ">
                                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                                        <div class="feature-item">
                                                            <i><img src="img/maid.png"></i>
                                                            <h3 style="font-family: Catamaran">保姆</h3>
                                                            <p>保姆, 厨师, 管家, 修理工, 深度清洁</p>
                                                        </div>
                                                    </a>
                                                </div>
                                                <div class="col-sm-6 col-lg-4 ">
                                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                                        <div class="feature-item">
                                                            <i><img src="img/repair1.png"></i>
                                                            <h3 style="font-family: Catamaran">修理 & 装修</h3>
                                                            <p>修理工, 电工, 家电维修, 木匠, 室内设计, 画家</p>
                                                        </div>
                                                    </a>
                                                </div>
                                                <div class="col-sm-6 col-lg-4 ">
                                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                                        <div class="feature-item">
                                                            <i><img src="img/beauty.png"></i>
                                                            <h3 style="font-family: Catamaran">美容服务</h3>
                                                            <p>理发, 剪发, 拉直, Spa, 按摩, 美甲, 修脚, 化妆</p>
                                                        </div>
                                                    </a>
                                                </div>
                                                <div class="col-sm-6 col-lg-4 ">
                                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                                        <div class="feature-item">
                                                            <i><img src="img/teach.png"></i>
                                                            <h3 style="font-family: Catamaran">家教</h3>
                                                            <p>所有费用唱歌跳舞艺术</p>
                                                        </div>
                                                    </a>
                                                </div>
                                                <div class="col-sm-6 col-lg-4 ">
                                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                                        <div class="feature-item">
                                                            <i><img src="img/truck2.png"></i>
                                                            <h3 style="font-family: Catamaran">包装 & 搬运工</h3>
                                                            <p>家具搬迁，公司/办公室搬迁</p>
                                                        </div>
                                                    </a>
                                                </div>
                                                <div class="col-sm-6 col-lg-4 ">
                                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                                        <div class="feature-item">
                                                            <i><img src="img/photo.png"></i>
                                                            <h3 style="font-family: Catamaran">摄影师</h3>
                                                            <p>个人，商务，婚礼，节日庆典摄影</p>
                                                        </div>
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </section>
                        <section class="contact" id="contact">
                            <div class="container">
                                <h2 class="text-white" style="font-family: Catamaran">什么是好先生?</h2>
                                <p class="text-justify" style="font-family: Catamaran;font-size: 19px;">
                                    好先生 是 100% 独立家政服务提供者，致力于为每一位用户提供最优质的家政服务。好先生拥有超过 25 年的行业经验，在提供高品质
                                </p>
                                <h3 class="text-white">通过社交媒体联系我们</h3>
                                <br>

                                <p><a
                                        href="https://www.facebook.com">
                                        <img height="47" width="47"
                                            src="img/face.png"></a>

                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                    <a
                                        href="https://twitter.com">
                                        <img height="47" width="47"
                                            src="img/twitter.png"></a>

                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                    <a
                                        href="https://in.linkedin.com">
                                        <img height="47" width="47"
                                            src="img/li.png"></a>



                                </p>

                            </div>
                        </section>
                        <footer>
                            <div class="container">
                                <p>&copy; 好先生 家政服务. 版权所有.</p>
                                <ul class="list-inline">
                                    <li class="list-inline-item">
                                        <a href="#">隐私</a>
                                    </li>
                                    <li class="list-inline-item">
                                        <a href="#">条款</a>
                                    </li>
                                </ul>
                            </div>
                        </footer>

                        <!-- Bootstrap core JavaScript -->
                        <script src="vendor/jquery/jquery.min.js"></script>
                        <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

                        <!-- Plugin JavaScript -->
                        <script src="vendor/jquery-easing/jquery.easing.min.js"></script>


                        <script src="js/new-age.min.js"></script>

                    </body>

                    </html>
    <?php
                }
            }
        }
    }
} else {

    ?>
    <!DOCTYPE html>
    <html lang="en">

    <head>

        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="description" content="">
        <meta name="author" content="">

        <title>好先生 | 家政服务</title>
        <link rel="shortcut icon" href="img/favicon.ico" />
        <!-- Bootstrap core CSS -->
        <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

        <!-- Custom fonts for this template -->
        <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet">
        <link rel="stylesheet" href="vendor/simple-line-icons/css/simple-line-icons.css">

        <!-- Plugin CSS -->
        <link rel="stylesheet" href="device-mockups/device-mockups.min.css">

        <!-- Custom styles for this template -->
        <link href="css/style.css" rel="stylesheet">
        <link href="css/hover-min.css" rel="stylesheet">
    </head>

    <body id="page-top">

        <!-- Navigation -->
        <nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
            <div class="container">
                <div class="navbar-header">
                    <a href="#top">
                        <img class="img-rounded" src="img/logo.png" />
                    </a>
                </div>
                &nbsp;
                <a class="navbar-brand " href="#page-top">
                    <h2><small style="font-family: Arial;border-bottom: 2px solid gainsboro">服务专家</small></h2>
                </a>
                <button class="navbar-toggler navbar-toggler-right ml-auto" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
                    菜单
                    <i class="fas fa-bars"></i>
                </button>
                <div class="collapse navbar-collapse" id="navbarResponsive">
                    <ul class="navbar-nav ml-auto">
                        <li class="nav-item">
                            <a class="nav-link js-scroll-trigger hvr-bounce-to-right" href="#contact">关于</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link js-scroll-trigger hvr-bounce-to-right" href="userlogin.php">用户登录/注册</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link js-scroll-trigger hvr-bounce-to-right" href="workerlogin.html">成为专业人士</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link js-scroll-trigger hvr-bounce-to-right" href="contact.html">联系我们</a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
        <header class="masthead">
            <div class="container h-100">
                <div class="row h-100">
                    <div class="col-lg-7 my-auto">
                        <div class="header-content mx-auto">
                            <div style="text-align: center;">
                                <h1 class="mb-5" style="font-family: Catamaran">欢迎来到<b>好先生 </b><br>专业的<br>家政服务网站<br> 专门为国人提供专业服务</h1>
                                <a href="#features" class="btn btn-outline btn-xl js-scroll-trigger"><b>探索我们的服务!</b></a>
                            </div>
                        </div>
                    </div>
                    <br><br>
                    <div class="col-lg-5 my-auto">
                        <div class="device-container">
                            <div class="device-mockup ipad white">
                                <div class="device">
                                    <div class="screen">
                                        <!-- Demo image for screen mockup, you can put an image here, some HTML, an animation, video, or anything else! -->
                                        <img src="img/q.jpg" class="img-fluid" alt="Image">

                                        <div class="overlay">
                                            <div class="text"><img src="img/p.jpg" alt="Image" class="image"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </header>
        <section class="features" id="features">
            <div class="container">
                <div style="text-align: center">
                    <h1 class="mb-5 text-dark" style="font-family: Catamaran">立即获得价格实惠可靠的服务...</h1>
                </div>
                <div class="row">
                    <div class="col-sm-12 col-lg-12 my-auto">
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-6 col-lg-4 ">
                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                        <div class="feature-item">
                                            <i><img src="img/maid.png"></i>
                                            <h3 style="font-family: Catamaran">保姆</h3>
                                            <p>保姆, 厨师, 管家, 修理工, 深度清洁</p>
                                        </div>
                                    </a>
                                </div>
                                <div class="col-sm-6 col-lg-4 ">
                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                        <div class="feature-item">
                                            <i><img src="img/repair1.png"></i>
                                            <h3 style="font-family: Catamaran">
                                                修理 & 装修</h3>
                                            <p>修理工, 电工, 家电维修, 木匠, 室内设计, 画家</p>
                                        </div>
                                    </a>
                                </div>
                                <div class="col-sm-6 col-lg-4 ">
                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                        <div class="feature-item">
                                            <i><img src="img/beauty.png"></i>
                                            <h3 style="font-family: Catamaran">美容服务</h3>
                                            <p>理发, 剪发, 拉直, Spa, 按摩, 美甲, 修脚, 化妆</p>
                                        </div>
                                    </a>
                                </div>
                                <div class="col-sm-6 col-lg-4 ">
                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                        <div class="feature-item">
                                            <i><img src="img/teach.png"></i>
                                            <h3 style="font-family: Catamaran">家教</h3>
                                            <p>所有费用唱歌跳舞艺术</p>
                                        </div>
                                    </a>
                                </div>
                                <div class="col-sm-6 col-lg-4 ">
                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                        <div class="feature-item">
                                            <i><img src="img/truck2.png"></i>
                                            <h3 style="font-family: Catamaran">包装 & 搬运工</h3>
                                            <p>家具搬迁，公司/办公室搬迁</p>
                                        </div>
                                    </a>
                                </div>
                                <div class="col-sm-6 col-lg-4 ">
                                    <a href="userlogin.php" class="hvr-bounce-to-bottom">
                                        <div class="feature-item">
                                            <i><img src="img/photo.png"></i>
                                            <h3 style="font-family: Catamaran">摄影师</h3>
                                            <p>个人，商务，婚礼，节日庆典摄影</p>
                                        </div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <section class="contact" id="contact">
            <div class="container">
                <h2 class="text-white" style="font-family: Catamaran">什么是好先生?</h2>
                <p class="text-justify" style="font-family: Catamaran;font-size: 19px;">
                    好先生 是 100% 独立家政服务提供者，致力于为每一位用户提供最优质的家政服务。好先生拥有超过 25 年的行业经验，在提供高品质
                </p>
                <h3 class="text-white">通过网站联系我们</h3>
                <br>

                <p><a
                        href="https://www.facebook.com">
                        <img height="47" width="47"
                            src="img/face.png"></a>

                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                    <a
                        href="https://twitter.com">
                        <img height="47" width="47"
                            src="img/twitter.png"></a>

                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                    <a
                        href="https://in.linkedin.com">
                        <img height="47" width="47"
                            src="img/li.png"></a>



                </p>

            </div>
        </section>
        <footer>
            <div class="container">
                <p>&copy; 好先生 家政服务. 版权所有.</p>
                <ul class="list-inline">
                    <li class="list-inline-item">
                        <a href="#">隐私</a>
                    </li>
                    <li class="list-inline-item">
                        <a href="#">条款</a>
                    </li>
                </ul>
            </div>
        </footer>

        <!-- Bootstrap core JavaScript -->
        <script src="vendor/jquery/jquery.min.js"></script>
        <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

        <!-- Plugin JavaScript -->
        <script src="vendor/jquery-easing/jquery.easing.min.js"></script>


        <script src="js/new-age.min.js"></script>

    </body>

    </html>
<?php
}
?>